import router from '../router/router.js'
import { getUrlParams } from '@/utils/mUtil.js'
import store from '../store'
router.beforeEach(async (to, from, next) => {
  if(to.fullPath == '/'){
    next()
  }
  let params = getUrlParams();
  if(params.ticket){
    const data = await store.dispatch('getTicker',{ ticket:params.ticket});
    if (data.code === '200') {
      next({ path: '/' })
    }
  }else {
    next()
  }
})

